From 73dc5465eabbdd5cce53eda3ec213dda25f99943 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 9 Jul 2007 20:01:54 +0000 Subject: [PATCH] Changed size requisition so the viewport does not add the border thickness 2007-07-09 Matthias Clasen * gtk/gtkviewport.c (gtk_viewport_size_request): Changed size requisition so the viewport does not add the border thickness if it has GTK_SHADOW_NONE selected. (#361781, Miguel Gomez) svn path=/trunk/; revision=18421 --- ChangeLog | 6 ++++++ gtk/gtkviewport.c | 12 ++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7662c9650e..44e898efdb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-07-09 Matthias Clasen + + * gtk/gtkviewport.c (gtk_viewport_size_request): Changed size + requisition so the viewport does not add the border thickness + if it has GTK_SHADOW_NONE selected. (#361781, Miguel Gomez) + 2007-07-09 Matthias Clasen * gtk/gtktooltip.c (gtk_tooltip_trigger_tooltip_query): diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c index 114415b088..48fac8329a 100644 --- a/gtk/gtkviewport.c +++ b/gtk/gtkviewport.c @@ -712,11 +712,15 @@ gtk_viewport_size_request (GtkWidget *widget, bin = GTK_BIN (widget); - requisition->width = (GTK_CONTAINER (widget)->border_width + - GTK_WIDGET (widget)->style->xthickness) * 2; + requisition->width = GTK_CONTAINER (widget)->border_width; - requisition->height = (GTK_CONTAINER (widget)->border_width * 2 + - GTK_WIDGET (widget)->style->ythickness) * 2; + requisition->height = GTK_CONTAINER (widget)->border_width; + + if (GTK_VIEWPORT (widget)->shadow_type != GTK_SHADOW_NONE) + { + requisition->width += 2 * widget->style->xthickness; + requisition->height += 2 * widget->style->ythickness; + } if (bin->child && GTK_WIDGET_VISIBLE (bin->child)) { -- 2.30.2